﻿<UserControl x:Class="Ewav.VariablesControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:System="clr-namespace:System;assembly=mscorlib" 
             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
             xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" 
             xmlns:Ewav_ContextMenu="clr-namespace:Ewav.ContextMenu;assembly=Ewav.ContextMenu.Menu" 
			 xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
    d:DesignWidth="740" d:DesignHeight="480" mc:Ignorable="d">
	<UserControl.Resources>
      
        <SolidColorBrush x:Key="rctBK" Color="#FFB8DDE7"/>
        <SolidColorBrush x:Key="rctBr" Color="#FF00AEEF"/>
        <ControlTemplate x:Key="btnRemove" TargetType="Button">
            <Grid>
                <Image Height="16" Source="remove.png" Stretch="Fill" VerticalAlignment="Center" HorizontalAlignment="Center" Width="16"/>
            </Grid>
        </ControlTemplate>
        <System:Double x:Key="rctStroke">0.4</System:Double>
        <ControlTemplate x:Key="btnAdd" TargetType="Button">
            <Grid Width="58">
                <Image Height="16" Source="add.png" Stretch="Fill" VerticalAlignment="Center" HorizontalAlignment="Left" Width="16" Margin="2,0,0,0"/>
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Add" Width="30" FontWeight="Bold" VerticalAlignment="Center" Margin="22,0,0,0"/>
            </Grid>
        </ControlTemplate>
        <Storyboard x:Name="rotatearrow">
            <DoubleAnimation Duration="0:0:0.5" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="imgSlide" d:IsOptimized="True"/>
        </Storyboard>
        <Storyboard x:Name="rotatearrow1">
            <DoubleAnimation Duration="0:0:0.5" To="-1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="imgSlide" d:IsOptimized="True"/>
        </Storyboard>
    </UserControl.Resources>

	<Grid x:Name="LayoutRoot" MouseLeftButtonDown="LayoutRoot_MouseLeftButtonDown" MouseRightButtonDown="LayoutRoot_MouseRightButtonDown" >
        <!--<Canvas x:Name="Slider" RenderTransformOrigin="0.5,0.5" Cursor="Hand" Margin="-629,-209,0,0" HorizontalAlignment="Left" VerticalAlignment="Center">
			<Canvas.Effect>
				<DropShadowEffect Color="#FF646161" ShadowDepth="2"/>
			</Canvas.Effect>
			<Canvas.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<Trans lateTransform/>
				</TransformGroup>
			</Canvas.RenderTransform>-->


        <Border x:Name="VSlider" Background="#FF5C53AC" CornerRadius="0,0,0,0" Padding="5" BorderBrush="#FF5C53AC" BorderThickness="1" Width="653" Height="235">
            <Border.Effect>
                <DropShadowEffect Color="#FF646161" ShadowDepth="2"/>
            </Border.Effect>
            <Border.RenderTransform>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform/>
                </TransformGroup>
            </Border.RenderTransform>
            <Grid VerticalAlignment="Top">
                    <TextBlock x:Name="VerticalHeading" Text="Defined Variables (0)" FontWeight="Normal" RenderTransformOrigin="0.5,0.5" 
					Foreground="White" HorizontalAlignment="Right" FontSize="16" VerticalAlignment="Center" Margin="0,25,-76,0" 
					Width="172" Height="23" TextOptions.TextFormattingMode="Display" TextOptions.TextHintingMode="Animated" TextOptions.TextRenderingMode="ClearType">
						<TextBlock.RenderTransform>
							<CompositeTransform Rotation="90"/>
						</TextBlock.RenderTransform>
                    </TextBlock>
                <Image x:Name="imgSlide" HorizontalAlignment="Right" Height="16" Source="/Ewav;component/Images/arrow.png" Stretch="Fill" Width="12" VerticalAlignment="Top" Margin="0,18,4,0" RenderTransformOrigin="0.5,0.5" Cursor="Hand">
                    	<Image.RenderTransform>
                    		<CompositeTransform ScaleX="-1"/>
                    	</Image.RenderTransform>
                    </Image>
                    <Rectangle x:Name="RectSlideIn" HorizontalAlignment="Right" VerticalAlignment="Top" Width="30" Height="233" Margin="0,-5,-5,0" Fill="#00EBEBEB" MouseLeftButtonDown="RectSlideIn_MouseLeftButtonDown" Cursor="Hand" />
                    <Border Margin="0" Background="#FFF7F3F3" Padding="0" CornerRadius="5" HorizontalAlignment="Left" Width="615">
                       
                            <StackPanel Orientation="Vertical" VerticalAlignment="Top" Width="593" Margin="10">
                        <TextBlock x:Name="filterCount" TextWrapping="Wrap" Text="Create User Defined Variables (0)" FontWeight="Normal" RenderTransformOrigin="0.5,0.5" TextOptions.TextFormattingMode="Display" HorizontalAlignment="Left" Margin="0,-4,0,4" FontSize="16"/>
							<Grid x:Name="grdFormattingProperties" Width="Auto" Margin="2,2,2,2" Visibility="Visible">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="2"/>
                            <RowDefinition Height="140"/>
                            <RowDefinition Height="7"/>
                            <RowDefinition Height="28"/>
                            <RowDefinition Height="7"/>
                        </Grid.RowDefinitions>

                       

                         <ScrollViewer x:Name="scroll_content" Grid.Row="1" HorizontalContentAlignment="Center" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Visible" DataContext="{Binding}" Grid.RowSpan="3" Margin="0,0,0,6" >
                                <StackPanel x:Name="pnlContainer" VerticalAlignment="Center" >
                                    <ListBox x:Name="lbxRules" d:LayoutOverrides="GridBox" Background="White" HorizontalContentAlignment="Left" MinHeight="133" />
                                </StackPanel>
						</ScrollViewer>

                        
                        <Grid Grid.ColumnSpan="4" Grid.Column="0" Grid.Row="4">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="134"/>
                                <ColumnDefinition Width="126"/>
                                <ColumnDefinition Width="Auto" MinWidth="96"/>
                            </Grid.ColumnDefinitions>

                            <Button x:Name="btnRemoveRule" Width="125" Content="Delete Variable" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Left" Click="btnRemoveRule_Click" Margin="11,0,0,0" Style="{StaticResource btnprimary}" />
                            <Button x:Name="btnEditRule" Width="109" Content="Edit Variable" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Click="btnEditRule_Click" Margin="15,0,0,0" Style="{StaticResource btnprimary}" />
                            <Button x:Name="btnNewRule" Width="132" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Click="btnNewRule_Click" Style="{StaticResource btnprimary}">
                                <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Orientation="Horizontal">
				        		<TextBlock Text="New Variable" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="White" FontSize="16" />
								<Path Data="M478,336 L478,354" Fill="#FFF4F4F5" HorizontalAlignment="Right" Height="16"  Stretch="Fill" Stroke="White" UseLayoutRounding="False" VerticalAlignment="Center" Width="1" Margin="6,0,4,0"/>
								<Image Height="16" Source="../../../Images/arrow_next_right.png" Stretch="Fill" Width="16" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" VerticalAlignment="Center">
									<Image.RenderTransform>
										<CompositeTransform Rotation="-90"/>
									</Image.RenderTransform>
								</Image>
							</StackPanel>
								<!--<Button.ContextMenu>
                                    <ContextMenu>
                                        <MenuItem x:Name="mnuNewRecodeRule" Header="With Recoded Value" Click="mnuNewRecodeRule_Click" />
                                        <MenuItem x:Name="mnuNewSimpleAssignRule" Header="With Simple Assignment" Click="mnuNewSimpleAssignRule_Click" />
                                        <MenuItem x:Name="mnuNewConditionalAssignRule" Header="With Conditional Assignment" Click="mnuNewConditionalAssignRule_Click" />
                                        <MenuItem x:Name="mnuNewFormatRule" Header="With Formatted Value" Click="mnuNewFormatRule_Click" />
                                        <MenuItem x:Name="mnuNewExpressionAssignRule" Header="With Assigned Expression" Click="mnuNewExpressionAssignRule_Click" />
                                        <Separator/>
                                        <MenuItem x:Name="mnuNewGroupRule" Header="Create Variable Group" Click="mnuNewVariableGroupRule_Click" />
                                    </ContextMenu>
                                </Button.ContextMenu>-->
                            </Button>
                            </Grid>
                    </Grid>
                    </StackPanel>
                        
                        
                    </Border>
                <toolkit:ContextMenu Name="menuVar" HorizontalAlignment="Left" VerticalAlignment="Top" MouseLeave="menuVar_MouseLeave" FontFamily="Segoe UI" FontSize="13.333" Margin="13.5,58.5,0,0" Canvas.ZIndex="53" Background="#FF5C53AC" Style="{StaticResource ContextMenuStyle1}" BorderBrush="#FF5C53AC" Visibility="Collapsed" >
			 
			            
			            <toolkit:MenuItem x:Name="varRecode" Header="With Recoded Value" Foreground="White" Click="varRecode_MouseLeftButtonDown"  />
                        <toolkit:MenuItem x:Name="varFormat" Header="With Formatted Value" Foreground="White" Click="varFormat_MouseLeftButtonDown"/>
                    	<toolkit:MenuItem x:Name="varSimple" Header="With Simple Assignment" Foreground="White" Click="varSimple_MouseLeftButtonDown"  />
                    	<toolkit:MenuItem x:Name="varAssign" Header="With Assigned Expression" Foreground="White" Click="varAssign_MouseLeftButtonDown"/>
                        <toolkit:MenuItem x:Name="varCondition" Header="With Conditional Assignment" Foreground="White" Click="varCondition_MouseLeftButtonDown"/>
                        <toolkit:Separator/>
						<toolkit:MenuItem x:Name="varGroup" Header="Create Variable Group" Foreground="White" Click="varGroup_MouseLeftButtonDown"/>
			        </toolkit:ContextMenu> 
                   <!-- <Ewav_ContextMenu:Menu x:Name="menuVar1"  HorizontalAlignment="Left" VerticalAlignment="Top" ItemSelected="MenuList_ItemSelected" d:LayoutOverrides="HorizontalAlignment" Canvas.ZIndex="53" RenderTransformOrigin="0.5,0.5" MouseLeave="menuVar_MouseLeave" Visibility="Collapsed" >
                    	<Ewav_ContextMenu:Menu.RenderTransform>
                    		<CompositeTransform TranslateX="13" TranslateY="211"/>
                    	</Ewav_ContextMenu:Menu.RenderTransform>
                        	
                    	<Ewav_ContextMenu:MenuItem x:Name="varRecode1" Text="With Recoded Value" MouseLeftButtonDown="varRecode_MouseLeftButtonDown"  />
                        <Ewav_ContextMenu:MenuItem x:Name="varFormat1" Text="With Formatted Value" MouseLeftButtonDown="varFormat_MouseLeftButtonDown"/>
                    	<Ewav_ContextMenu:MenuItem x:Name="varSimple1" Text="With Simple Assignment" MouseLeftButtonDown="varSimple_MouseLeftButtonDown"  />
                    	<Ewav_ContextMenu:MenuItem x:Name="varAssign1" Text="With Assigned Expression" MouseLeftButtonDown="varAssign_MouseLeftButtonDown"/>
                        <Ewav_ContextMenu:MenuItem x:Name="varCondition1" Text="With Conditional Assignment" MouseLeftButtonDown="varCondition_MouseLeftButtonDown"/>

                </Ewav_ContextMenu:Menu>-->
                </Grid>
            </Border>
        
        <!--</Canvas>-->
    </Grid>
</UserControl>
